DicDetailForm = Ext.extend(Ext.Window, {
	formPanel : null,
	constructor : function(a) {
		Ext.applyIf(this, a);
		this.initUIComponents();
		DicDetailForm.superclass.constructor.call(this, {
			layout : "fit",
			id : "DicDetailFormWin",
			iconCls : "menu-dictionary",
			items : this.formPanel,
			title : "字典详细信息",
			width : 380,
			height : 200,
			modal : true,
			buttonAlign : "center",
			buttons : this.buttons
		});
	},
	initUIComponents : function() {
		this.formPanel = new Ext.FormPanel({
			url : __ctxPath + "/system/saveDicDetail.do",
			layout : "form",
			id : "DicDetailForm",
			bodyStyle : "padding:5px",
			border : false,
			formId : "DicDetailFormId",
			defaultType : "textfield",
			defaults : {
				anchor : "98%,98%"
			},
			items : [ {
				name : "dicDetail.detailId",
				id : "detailId",
				xtype : "hidden",
				value : this.detailId == null ? "" : this.detailId
			}, {
				xtype : "hidden",
				value : this.parentId,
				name : "dicDetail.dicType.id"
			}, {
				fieldLabel : "编号"+'<font color=red>*</font>',
				allowBlank : false,
				name : "dicDetail.codeNo",
			}, {
				fieldLabel : "名字"+'<font color=red>*</font>',
				allowBlank : false,
				name : "dicDetail.codeName"
			},{
                fieldLabel : "备注",
                xtype:"textarea",
                name : "dicDetail.remark"
            } ]
		});
		if (this.detailId != null && this.detailId != "undefined") {
			this.formPanel.loadData(
					{						
						waitMsg : "正在载入数据...",
						url : __ctxPath
                        + "/system/getDicDetail.do?detailId="
                        + this.detailId,
                        preName : "dicDetail",
                        root : "result"
						
					});
		}
		this.buttons = [ {
			text : "保存",
			iconCls : "btn-save",
			handler : this.save.createCallback(this.formPanel, this)
		}, {
			text : "重置",
			iconCls : "btn-reset",
			handler : this.reset.createCallback(this.formPanel)
		}, {
			text : "取消",
			iconCls : "btn-cancel",
			handler : this.cancel.createCallback(this)
		} ];
	},
	reset : function(a) {
		a.getForm().reset();
	},
	cancel : function(a) {
		a.close();
	},
	save : function(a, b) {
		var c = b.callback;
		if (a.getForm().isValid()) {
			a.getForm().submit({
				method : "POST",
				waitMsg : "正在提交数据...",
				success : function(d, e) {
					Ext.ux.Toast.msg("操作信息", "成功保存信息！");
					Ext.getCmp("dicGrid").getStore().reload();
//					if (b.callback) {
//						b.callback.call(this);
//					}
//					
					b.close();
				},
				failure : function(d, e) {
					Ext.MessageBox.show({
						title : "操作信息",
						msg : "信息保存出错，请联系管理员！",
						buttons : Ext.MessageBox.OK,
						icon : Ext.MessageBox.ERROR
					});
				}
			});
		}
	}
});